package com.open.capacity.notice.enums;

import lombok.Getter;

/**
 * job状态变化枚举
 */
@Getter
public enum SendJobStatusChangeEnum {

	JOB_CREATED(SendMessageJobStatus.NULL, SendMessageJobStatus.CREATED, SendMessageOperateType.NEW_JOB, "created"),
	
	JOB_SPLIT(SendMessageJobStatus.CREATED, SendMessageJobStatus.TASK_CREATED, SendMessageOperateType.SPLIT_JOB, "splited"),
	
	JOB_CREATE_CANCELL(SendMessageJobStatus.CREATED, SendMessageJobStatus.CANCELLED, SendMessageOperateType.CANCEL_JOB, "canceled"),
	
	JOB_SPLIT_CANCELL(SendMessageJobStatus.TASK_CREATED, SendMessageJobStatus.CANCELLED, SendMessageOperateType.CANCEL_JOB, "canceled"),
	
	JOB_SUCCESS(SendMessageJobStatus.TASK_CREATED, SendMessageJobStatus.SUCCESS, SendMessageOperateType.SUCCESS, "successed"),
	
	JOB_FAILURE(SendMessageJobStatus.TASK_CREATED, SendMessageJobStatus.FAILURE, SendMessageOperateType.FAILURE, "failured"),


	;

	SendJobStatusChangeEnum(SendMessageJobStatus fromStatus, SendMessageJobStatus toStatus,
			SendMessageOperateType operateType, String tags) {
		this.fromStatus = fromStatus;
		this.toStatus = toStatus;
		this.operateType = operateType;
		this.tags = tags;
		this.sendEvent = true;
	}

	SendJobStatusChangeEnum(SendMessageJobStatus fromStatus, SendMessageJobStatus toStatus,
			SendMessageOperateType operateType, boolean sendEvent) {
		this.fromStatus = fromStatus;
		this.toStatus = toStatus;
		this.operateType = operateType;
		this.sendEvent = sendEvent;
	}

	private SendMessageJobStatus fromStatus;
	private SendMessageJobStatus toStatus;
	private SendMessageOperateType operateType;
	private String tags;
	private boolean sendEvent;
}
